<?php include_once '../Model/usuarioDao.php';?>
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

//$nombre=$_POST['firstName'];
//echo $nombre;
$firstName=$_POST['firstName'];
$middleName=$_POST['middleName'];
$lastName=$_POST['lastName'];
$rol=$_POST['rol'];
$department=$_POST['department'];
$company=$_POST['company'];
$mail=$_POST['mail'];
$user=$_POST['user'];

$result = modificarUsuario($firstName,$middleName,$lastName,$rol,$department,$company,$mail,$user);
if ($result)
    header('Location: ../Menu/menuPrincipal.php');
else
    header('Location: ../Menu/editarUsuario.php');

//echo 'Termine update';
//echo $result;
/*$results = usuarios();
$cant = count($results);
for ($i = 0; $i < $cant; $i++) {
    echo $results[$i]['userName'];
    echo '<br>';
    echo $results[$i]['firstName'];
    echo '<br>';
    echo $results[$i]['middleName'];
    echo '<br>';
    echo $results[$i]['LastName'];
    echo '<br>';
    echo $results[$i]['roleCode'];
    echo '<br>';
    echo $results[$i]['idDepartment'];
    echo '<br>';
    echo $results[$i]['idCompany'];
    echo '<br>';
    echo $results[$i]['userMail'];
    echo '<br>';
    echo $results[$i]['modificationDate'];
    echo '<br>';
    echo $results[$i]['modificationUser'];
    echo '<br>';
    echo '<br>';
}*/


/*if($result)
    echo 'Usuario Modificado';*/
/*echo $firstName;
echo '<br>';
echo $middleName;
echo '<br>';
echo $lastName;
echo '<br>';
echo $rol;
echo '<br>';
echo $department;
echo '<br>';
echo $company;
echo '<br>';
echo $mail;
echo '<br>';
echo $user;*/